package cn.edu.jsu.official.pojo.dto;

import cn.edu.jsu.official.serializer.DateSerializer;
import cn.edu.jsu.official.serializer.DateTimeSerializer;
import cn.edu.jsu.official.serializer.ObjectIdSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;
import java.util.List;

/**
 * @author Mo
 * @createTime 2022/3/1 16:44
 * @description
 */
@Data
@Document(collection = "project_achievement")
public class ProjectAchievement {
    @Id
    @ApiModelProperty("主键Id")
    private String projectAchievementId;

    @ApiModelProperty("参与人员")
    private List<String> projectMember;

    @ApiModelProperty("项目名称")
    private String projectName;

    @ApiModelProperty("项目简介")
    private String projectIntroduction;

    @ApiModelProperty("项目完成日期")
    @JSONField(serializeUsing = DateSerializer.class, deserializeUsing = DateSerializer.class)
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date completedDate;

    @ApiModelProperty("上传日期")
    @JSONField(serializeUsing = DateTimeSerializer.class, deserializeUsing = DateTimeSerializer.class)
    private Date uploadDate;

    @ApiModelProperty("封面ObjectId")
    @JSONField(serializeUsing = ObjectIdSerializer.class, deserializeUsing = ObjectIdSerializer.class)
    private ObjectId frontCoverId;

    @ApiModelProperty("文章ObjectId")
    @JSONField(serializeUsing = ObjectIdSerializer.class, deserializeUsing = ObjectIdSerializer.class)
    private ObjectId articleId;

    public ProjectAchievement() {
    }

    public ProjectAchievement(String projectAchievementId, List<String> projectMember, String projectName, String projectIntroduction, Date completedDate, Date uploadDate, ObjectId frontCoverId, ObjectId articleId) {
        this.projectAchievementId = projectAchievementId;
        this.projectMember = projectMember;
        this.projectName = projectName;
        this.projectIntroduction = projectIntroduction;
        this.completedDate = completedDate;
        this.uploadDate = uploadDate;
        this.frontCoverId = frontCoverId;
        this.articleId = articleId;
    }

    @Override
    public String toString() {
        return "ProjectAchievement{" +
                "projectAchievementId='" + projectAchievementId + '\'' +
                ", projectMember=" + projectMember +
                ", projectName='" + projectName + '\'' +
                ", projectIntroduction='" + projectIntroduction + '\'' +
                ", completedDate=" + completedDate +
                ", uploadDate=" + uploadDate +
                ", frontCoverId=" + frontCoverId +
                ", articleId=" + articleId +
                '}';
    }

    public String getProjectAchievementId() {
        return projectAchievementId;
    }

    public void setProjectAchievementId(String projectAchievementId) {
        this.projectAchievementId = projectAchievementId;
    }

    public List<String> getProjectMember() {
        return projectMember;
    }

    public void setProjectMember(List<String> projectMember) {
        this.projectMember = projectMember;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getProjectIntroduction() {
        return projectIntroduction;
    }

    public void setProjectIntroduction(String projectIntroduction) {
        this.projectIntroduction = projectIntroduction;
    }

    public Date getCompletedDate() {
        return completedDate;
    }

    public void setCompletedDate(Date completedDate) {
        this.completedDate = completedDate;
    }

    public Date getUploadDate() {
        return uploadDate;
    }

    public void setUploadDate(Date uploadDate) {
        this.uploadDate = uploadDate;
    }

    public ObjectId getFrontCoverId() {
        return frontCoverId;
    }

    public void setFrontCoverId(ObjectId frontCoverId) {
        this.frontCoverId = frontCoverId;
    }

    public ObjectId getArticleId() {
        return articleId;
    }

    public void setArticleId(ObjectId articleId) {
        this.articleId = articleId;
    }

}
